package com.sun.test.config;

import com.alibaba.druid.pool.DruidDataSource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;

/**
 * @author zhangquanwei
 * @version 1.0
 * @date 2024-12-17 18:53
 */
@Configuration
@Slf4j
public class DruidDatasourceConfig {


    @Bean
    @ConfigurationProperties("spring.datasource")
    public DataSource druidDataSource() {
        log.info("创建数据库连接池");
        return new DruidDataSource();
    }
}
